<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" th:href="@{/static/commen/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{../../static/back/css/admin.css}" media="all">
    <link rel="stylesheet" th:href="@{/static/back/css/formSelects-v4.css}" media="all">
</head>
<body class="layui-layout-body">

    <div class="" style="margin: 1%">

        <button class="layui-btn layui-btn-normal" onclick="addPlate()">创建板块</button>

        <table id="plateList" lay-filter="plateTable"></table>

        <script type="text/html" id="optBar">
            <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
            {{#  if(d.plateStatus == '0'){ }}
            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="recover">恢复</a>
            {{#  } else { }}
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
            {{#  } }}
        </script>
    </div>

     <!--底部-->
    <script th:src="@{/static/back/js/jquery-3.4.1.min.js}"></script>
    <script th:src="@{/static/commen/layui.js}"></script>
    <link th:href="@{/static/lib/layui_exts/cropper/cropper.css}" rel="stylesheet"/>
    <script th:src="@{/static/lib/layui_exts/cropper/croppers.js}"></script>
    <script th:src="@{../../static/back/js/admin.js}"></script>
    <script th:src="@{/static/back/js/plate.js}"></script>
</body>
</html>
<script>
    layui.config({
        base: '/static/lib/layui_exts/cropper/' //layui自定义layui组件目录
    }).use(['form', 'croppers'], function () {
        var $ = layui.jquery
            , form = layui.form
            , croppers = layui.croppers
            , layer = layui.layer;

        //创建一个头像上传组件
        croppers.render({
            elem: '#plateImgButton'
            , saveW: 370     //保存宽度
            , saveH: 244
            , mark: 1 / 1    //选取比例
            , area: '1200px'  //弹窗宽度
            , url: "/common/upload?type=plate"//图片上传接口返回和（layui 的upload 模块）返回的JOSN一样
            , done: function (path) { //上传完毕回调
                $("#website_logo").val(path);
                $("#images_url").attr('src', path);
            }
        });

    });
    layui.extend({
        tinymce: '../tinymce/tinymce'
    }).use(['tinymce', 'util', 'layer'], function () {
        var $ = layui.jquery
            , tinymce = layui.tinymce
            , layer = layui.layer;
        var edit = tinymce.render({
            elem: "#container"
            , height: 600
            , width:'100%'
        });
    });
</script>